/**
 * 
 */
package org.sca.middle.cmpe.dto;

import java.io.Serializable;

/**
 * @author Kevin Carlen
 * @version 1.0
 */
public class AuthCategory implements Serializable, Comparable<AuthCategory> {

	/**
	 * UID for {@link java.io.Serializable}
	 */
	private static final long serialVersionUID = -3632549502102427263L;

	/** Key value */
	private Long authCategoryId;
	
    /** authorization description */
    private String description;
    
    /** the sort order */
    private int orderValue;


	/**
	 * @return the authCategoryId
	 */
	public Long getAuthCategoryId() {
		return authCategoryId;
	}


	/**
	 * @param authCategoryId the authCategoryId to set
	 */
	public void setAuthCategoryId(Long authCategoryId) {
		this.authCategoryId = authCategoryId;
	}


	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}


	/**
	 * @param description the description to set
	 */
	public void setDescription(String description) {
		this.description = description;
	}


	/**
	 * @return the orderValue
	 */
	public int getOrderValue() {
		return orderValue;
	}


	/**
	 * @param orderValue the orderValue to set
	 */
	public void setOrderValue(int orderValue) {
		this.orderValue = orderValue;
	}


	/**
	 * Determines comparison based on orderValue. If orderValue is the same then base comparison on description.
	 * @param arg0 the other {@link AuthCategory} to compare to
	 * @return the difference in orderValue
	 * @see java.lang.Comparable#compareTo(java.lang.Object)
	 */
	@Override
	public int compareTo(AuthCategory arg0) {
		if (arg0.getOrderValue() == getOrderValue()) {
			return getDescription().compareTo(arg0.getDescription());
		}
		return arg0.getOrderValue() - getOrderValue();
	}

}
